#ifndef _Task
#define _Task

#include "ParamManager.h"
#include "BlockManager.h"


enum State {
	PENDING,
	ACTIVE,
	COMPLETE
};

class Task {

public:
	// for link list purposes	
	Task *prev, *next;

	BlockManager bm;

	char *id;
	State state;
	int threads;

	ParamManager pm;

	// if a block is currently checked out
	bool isCheckout;
	// if a task is currently busy, we delay before asking again
	bool isBusy;
	// if the task has been deleted, we need to cleanup and delete
	bool isShutdown;
	// time of block checkout, relevant if task returns busy
	time_t t_curr;
	

	// Constructor
	Task();
	// Deconstructor
	~Task();
};

#endif /* _TASK */